#include <57header.h>

void fun(int num){
    printf("fun run before\n");
    sleep(30);
    printf("fun run over \n");
}
int main(int argc,char*argv[])
{
    
    struct sigaction act, old;
    memset(&act, 0, sizeof(act));
    memset(&old, 0, sizeof(old));

    act.sa_handler = fun;

    // 定义和初始化set
    sigset_t set;
    sigemptyset(&set);
    // 把3号信号放入屏蔽集合
    sigaddset(&set, 3);

    act.sa_mask = set;

    sigaction(2, &act, &old);

    while(1);
    return 0;
}

